cmake_minimum_required (VERSION 3.20)

add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")   

if (MSVC) 
    add_definitions("/wd4251" "/wd4244")
    add_definitions(-DWIN32)
endif ()

##
## ODV 应用业务封装
##

message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")

set(MODULE_NAME odvAppModule)

file(GLOB_RECURSE INCLUDE_LIST "*.h")
aux_source_directory(./ SRC_LIST)

add_library(${MODULE_NAME} ${INCLUDE_LIST} ${SRC_LIST})

target_include_directories(${MODULE_NAME} PUBLIC
    ${OSGEARTH_INCLUDE_DIRS}
    ${OPENSCENEGRAPH_INCLUDE_DIRS}
)

target_link_libraries(${MODULE_NAME} PUBLIC
    ${OPENSCENEGRAPH_LIBRARIES}
    ${OSGEARTH_LIBRARY}
    ${OSGEARTHFEATURES_LIBRARY}
    ${OSGEARTHUTIL_LIBRARY}
    ${OSGEARTHSYMBOLOGY_LIBRARY}
    ${OSGEARTHANNOTATION_LIBRARY}
)

#link DA
target_include_directories(${MODULE_NAME}
    PUBLIC ${DA_DIR}/include
)
target_link_directories(${MODULE_NAME}
    PUBLIC ${DA_DIR}/lib
)
target_link_libraries(${MODULE_NAME} PUBLIC
    debug data${LIBRARY_POSTFIX} optimized data
    debug data_reader${LIBRARY_POSTFIX} optimized data_reader
    debug data_writer${LIBRARY_POSTFIX} optimized data_writer
	debug netcdf_cxx${LIBRARY_POSTFIX} optimized netcdf_cxx
    )

# line odv
target_include_directories(${MODULE_NAME} PUBLIC
    ${ODV_INCLUDE_DIRS}
)

target_link_libraries(${MODULE_NAME} PUBLIC
    odv::Core
    odv::GUI
    odv::Utils
    odv::Log
)

# line Qt5
target_link_libraries(${MODULE_NAME} PUBLIC
    Qt5::Core
    Qt5::Gui
    Qt5::Widgets
)